package com.example.myproject.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.myproject.model.UserRatioLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserRatioLogMapper extends BaseMapper<UserRatioLog> {
    @Select("""
        SELECT upload FROM user_ratio_log
         WHERE user_id = #{userId}
         ORDER BY time DESC
         LIMIT #{limit}
    """)
    List<Long> findLastNUploads(@Param("userId") Long userId, @Param("limit") int limit);
}
